package com.yq.day20._01practice;

/**
 * @author 3307235355@qq.com
 * @since 2022/06/20 08:34
 */
public class Demo01 {
    public static void main(String[] args) {
        Student s = new Student();
        System.out.println(s.test(10, 23, (a, b) -> a + b));
        System.out.println(s.test(10, 23, (a, b) -> a * b));
        System.out.println(s.test(10, 23, (a, b) -> a / b));
        System.out.println(s.test(10, 23, (a, b) -> a - b));


    }
}

class Student {
    public int test(int a, int b, Calculation c) {
        return c.calculation(a,b);
    }
}

@FunctionalInterface
interface Calculation {
    int calculation(int a, int b);
}


